package com.itlong.cloud.controller.temp;

import com.itlong.cloud.POJO.VO.MessageVO;
import com.itlong.cloud.annotation.LoggerInfo;
import com.itlong.cloud.annotation.UnAuthAccessRequired;
import com.itlong.cloud.annotation.UnParamEncrypt;
import com.itlong.cloud.constants.LogDescConstant;
import com.itlong.cloud.enumerate.ecode.BaseErrorCodeEnum;
import com.itlong.cloud.equip.app.IAppCloudElevatorCallStatusServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import sun.rmi.runtime.Log;

/**
 * Created by PPP on 2020/4/13.
 */
@RestController
@RequestMapping("/temp")
public class TempController {
    @Autowired
    IAppCloudElevatorCallStatusServiceClient iAppCloudElevatorCallStatusServiceClient;


    /**
     * <desc>
     *      手动触发呼梯记录数据迁移
     * </desc>
     *
     * @return
     *
     */
    @RequestMapping("deleteCold")
    @ResponseBody
    @UnAuthAccessRequired
    @LoggerInfo(operateDesc = LogDescConstant.CALL_ELEVATOR_DATA_REMOVE_LOG_DESC)
    @UnParamEncrypt
    public MessageVO deleteCold() throws Exception {
        try {
            iAppCloudElevatorCallStatusServiceClient.coldDataRemove();
            return new MessageVO(BaseErrorCodeEnum.SUCCESS.getErrorCode());
        }catch (Exception e){
            return new MessageVO(BaseErrorCodeEnum.ERROR.getErrorCode(),e);
        }
    }
}